import java.util.Scanner;

public class text3 {
    public static int fun3(int[] array,int val){
        int left=0;
        int right= array.length-1;
        while(left<=right){
            int m=left+(right-left)/2;
            if(array[m]<val){
                left=m+1;
            } else if(array[m]>val){
                right=m-1;
            } else {
                return m;
            }
        }
        return -1;
    }

    public static void main(String[] args) {
        int[] array ={1,2,3,4,5,6,7};
        Scanner sc = new Scanner(System.in);
        int val = sc.nextInt();
        int x=fun3(array,val);
        System.out.println(x);
        sc.close();
    }
}
